package br.com.news.service;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.apache.log4j.Logger;

import br.com.news.utils.database.beans.CategoriaBean;
import br.com.news.utils.database.interfaces.ICategoriaService;
import br.com.news.utils.service.interfaces.IServices;

@Named
public class Services implements IServices{

	private final Logger logger = Logger.getLogger(getClass());

	@Inject
	private ICategoriaService categoriaService;

	@Override
	public List<CategoriaBean> findAllCategoriaBeans() {
		if (this.logger.isDebugEnabled())
			this.logger.debug("Service invoked - findAllCatedorias");

		return this.categoriaService.findAll();
	}

	@Override
	public void deleteCategoria(CategoriaBean categoria) {
		this.categoriaService.delete(categoria);
	}

	@Override
	public void updateCategoria(CategoriaBean categoria) {
		this.categoriaService.update(categoria);
	}

	@Override
	public Long insertCategoria(CategoriaBean categoria) {
		return this.categoriaService.insert(categoria);
	}

}
